define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Liveplay, $window, $timeout) {
		$scope.isLoad = false; //可以加载
		//画面加载
		$scope.$on('$ionicView.afterEnter', function() {
			//动态设置高度
			var all = $window.innerHeight;
			//计算滚动条
			$scope.myObj = {
				"height": all - 44 + "px"
			};
		}, false);
		Liveplay.get_list(function(data) {
			$scope.list = data;
		});
		//下拉刷新 判断哪个模块进行刷新
		$scope.doRefresh = function() {
			$timeout(function() {
				$scope.$broadcast('scroll.refreshComplete');
			}, 1000);
		};
		//加载更多
		$scope.doRefreshMore = function() {
			$timeout(function() {
				$scope.$broadcast('scroll.infiniteScrollComplete');
			}, 1000);
		}
	}

	controller.$inject = ['$scope', 'Liveplay', '$window', '$timeout'];

	return app.registerController("liveplayctrl",controller);
});